Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
@babel/plugin-transform-property-literals
Advanced tools
Ensure that reserved words are quoted in object property keys
The @babel/plugin-transform-property-literals package is a Babel plugin that transforms object properties to use literals when they are valid identifiers. This transformation can help improve code readability and potentially optimize execution by leveraging engine optimizations for property access.
Transforming Reserved Word Properties
Transforms reserved word properties into literal properties if they are valid identifiers, ensuring compatibility and potentially improving execution speed.
{"var": "value"} // Before transformation
{"var": "value"} // After transformation
Transforming Numeric Properties
Automatically transforms numeric properties into their literal form, enhancing code readability and leveraging engine optimizations.
{"123": "value"} // Before transformation
{123: "value"} // After transformation
This plugin transforms reserved words into a form that can be safely used as property keys. It is similar to @babel/plugin-transform-property-literals but focuses more on reserved words in JavaScript.
Transforms property mutators to use a more compatible syntax. While it deals with properties, its focus is more on the mutation aspect rather than transforming property keys into literals.
Ensure that reserved words are quoted in object property keys
See our website @babel/plugin-transform-property-literals for more information.
Using npm:
npm install --save-dev @babel/plugin-transform-property-literals
or using yarn:
yarn add @babel/plugin-transform-property-literals --dev
v7.25.9 (2024-10-22)
babel-parser
, babel-template
, babel-types
syntacticPlaceholders
mode (@liuxingbaoyu)babel-helper-compilation-targets
, babel-preset-env
ClassAccessorProperty
to prevent the no-undef
rule (@victorenator)babel-parser
, babel-types
VISITOR_KEYS
etc. faster to access (@liuxingbaoyu)FAQs
Ensure that reserved words are quoted in object property keys
The npm package @babel/plugin-transform-property-literals receives a total of 8,682,021 weekly downloads. As such, @babel/plugin-transform-property-literals popularity was classified as popular.
We found that @babel/plugin-transform-property-literals demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.